# coding=utf8

from BaseTable import Table


class User(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('user')
        self._age = Table.Cell('user')
        self._passwd = Table.Cell('user')
        self._favorite = Table.OneToManyCell('Goods')

    def set_name(self, name):
        self._name = name

    def set_age(self, age):
        self._age = age

    def set_passwd(self, passwd):
        self._passwd = passwd

    def set_favorite(self, favorite):
        self._favorite = favorite

    def name(self):
        return self._name

    def age(self):
        return self._age

    def passwd(self):
        return self._passwd

    def favorite(self):
        return self._favorite


class Goods(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('goods')
        self._price = Table.Cell('goods')

    def set_name(self, name):
        self._name = name

    def set_price(self, price):
        self._price = price

    def name(self):
        return self._name

    def price(self):
        return self._price
